// rollup.config.js
import { nodeResolve } from '@rollup/plugin-node-resolve'
import path from 'path'
// import typescript from 'rollup-plugin-typescript2';

const version = process.env.VERSION || require('./package.json').version
const banner =
  '/*!\n' +
  ` * Time.js v${version}\n` +
  ` * (c) 2022-${new Date().getFullYear()} Jack Dou\n` +
  ' * Released under the MIT License.\n' +
  ' */'
export default {
  // 核心选项
  input: path.resolve(__dirname, './src/index.js'),     // 必须
  plugins: [
    nodeResolve(),
    // typescript()
  ],
  output: {
    name: 'Time',
    file: path.resolve(__dirname, 'build/time.js'),
    format: 'umd', // 浏览器打包格式
    banner,
  },
};
